package vwg.na.vwm.rh.motorsdk.util.componentes;

import org.primefaces.component.commandbutton.CommandButton;

import vwg.na.vwm.rh.rhmotor.modelo.entidad.Accion;

public class RHBotonAccion extends CommandButton {
	private Accion accion;
	public final static char REGRESAR = Accion.SUSPENDER_ACCION_REGRESAR;
	public final static char CANCELAR = Accion.SUSPENDER_ACCION_CANCELAR;
	public final static char SALVAR = 'S';

	private Character identificadorAccion;

	public RHBotonAccion(final Accion accion) {
		this.accion = accion;
		setIdentificadorAccion();
		setValue(accion.getNombre());
		setId("id_" + String.valueOf(accion.hashCode()));
		setTransient(true);
	}

	public Character getIdentificadorAccion() {
		return identificadorAccion;
	}

	private void setIdentificadorAccion() {
		this.identificadorAccion = accion.getSuspender();
	}
	
	public Accion getAccion() {
		return this.accion;
		
	}

}
